#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QColor>
#include <QMouseEvent>
#include <QEvent>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    /** @brief  窗口初始化
    */
    void init();

    /**窗口属性设置**/
    QColor mainBackground = QColor(251, 251, 251);   //主背景色

    bool maximized = false; //是否最大化
    /**窗口拖拽特效重载**/
    enum {AT_LEFT = 1, AT_TOP = 2,  AT_RIGHT = 4, AT_BOTTOM = 8,
          AT_TOP_LEFT = 3, AT_TOP_RIGHT = 6, AT_BOTTOM_LEFT = 9, AT_BOTTOM_RIGHT = 12};
    bool mousePressed = false;  //鼠标是否按下
    int mouseState;     //鼠标状态
    QPoint pressedPos;  //窗口按压点
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void resizeEvent(QResizeEvent* event) override;

    /** @brief  窗口大小控制
    */
    void controlWindowScale();

};
#endif // MAINWINDOW_H
